package com.manager.model;

import java.util.ArrayList;
import java.util.List;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;

/**
 * 角色
 * @author zlj
 *
 */
@SuppressWarnings("all")
@Entity
@Table(name = "tb_sys_role")
public class System_Role extends AllId {

	private static final long serialVersionUID = 1L;
	
	private String name;//角色名称
	
	private String description;//描述
	
	private String status;//0:禁用 1：启用

	private Integer defaultStatus;//0: 否，1：是默认角色

	//预留字段
	private String temp1;
	
	private String temp2;
	
	private String temp3;
	
	public static String[] config = new String[]{"listur","listrp"};
	
	private List<System_User_Role> listur = new ArrayList<System_User_Role>();
	
	private List<System_Role_Permission> listrp = new ArrayList<System_Role_Permission>();
	
	@Column(name = "roleName")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTemp1() {
		return temp1;
	}

	public void setTemp1(String temp1) {
		this.temp1 = temp1;
	}

	public String getTemp2() {
		return temp2;
	}

	public void setTemp2(String temp2) {
		this.temp2 = temp2;
	}

	public String getTemp3() {
		return temp3;
	}

	public void setTemp3(String temp3) {
		this.temp3 = temp3;
	}

	@OneToMany(fetch = FetchType.LAZY,orphanRemoval=true,mappedBy = "sys_role")
	public List<System_User_Role> getListur() {
		return listur;
	}

	public void setListur(List<System_User_Role> listur) {
		this.listur = listur;
	}

	@OneToMany(fetch = FetchType.LAZY,orphanRemoval=true,mappedBy = "sys_role")
	public List<System_Role_Permission> getListrp() {
		return listrp;
	}

	public void setListrp(List<System_Role_Permission> listrp) {
		this.listrp = listrp;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Integer getDefaultStatus() {
		return defaultStatus;
	}

	public void setDefaultStatus(Integer defaultStatus) {
		this.defaultStatus = defaultStatus;
	}
}
